﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using XStudio.XCRF.Data.Business.Permissions;
using XStudio.XCRF.Data.Business;
using XStudio.XCRF.Data.Entities.CureInfo;

namespace XStudio.XCRF.Web.Controllers
{
    /// <summary>
    /// 测试控制器，最终发布会删除
    /// </summary>
    [DefaultPermission(PermissionType.Allow)]
    public class TestController : BaseController
    {
        public ActionResult Index()
        {
            ViewBag.PatientID = DataContext.Patients.GetMasterRecords().First().ID;
            ViewBag.CRFID = DataContext.CRFs.GetMasterRecords().First().ID;
            ViewBag.BasicInfoID = DataContext.BasicInfoes.GetMasterRecords().First().ID;
            ViewBag.LabCheckID = DataContext.LabChecks.GetMasterRecords().First().ID;
            ViewBag.CureInfoID = DataContext.CureInfoes.GetMasterRecords().First().ID;
            return View();
        }
        public ActionResult TestDisease()
        {
            List<Disease> diseases = DataContext.Diseases.OrderBy(d => d.Name).Take(2).ToList();
            IEnumerable<Herb> herbs = diseases.GetHerbs();
            return View(diseases);
        }

        public ActionResult TestDiseaseReceive(List<Disease> diseases)
        {
            return View();
        }
    }
}
